const os = require('os')
const { defineConfig } = require('@vue/cli-service')
const BunldeAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
const HappyPack = require('happypack')
const webpack = require('webpack')
var happypackThreadPool = HappyPack.ThreadPool({ size: os.cpus().length })
module.exports = defineConfig({
    transpileDependencies: true,
    publicPath: './',
    lintOnSave: false,
    devServer: {
        proxy: 'http://nhcj.app65.cn/'
        // proxy: 'http://192.168.101.162:1021/'
    },
    productionSourceMap: false,
    configureWebpack: {
        optimization: {
            splitChunks: {
                chunks: 'all',
                maxSize: 1024 * 512
            }
        },
        plugins: [
            new HappyPack({
                id: 'happyBabel',
                threadPool: happypackThreadPool,
                verbose: true,
                loaders: ['babel-loader']
            }),
            // new BunldeAnalyzerPlugin()
        ]
    }
})
